package com.dcy.znoa.controller.attendance.model.attUserRule;

/**
 * @author pengyu
 */

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AURBindModel {

//    Long attRuleId;//考勤规则ID    数据库生成
    @NotNull
    Integer attRuleNo;//规则编号 后台生成
    @NotNull
    String operIdsStr;//用户ID 逗号分隔

    int[] ids;

    public static int[] String2Ints(String strs){
        if(StringUtils.isBlank(strs)){
            return null;
        }
        String[] ids = strs.split(",");
        int[] idInt = new int[ids.length];
        for (int i = 0; i < ids.length; i++) {
            idInt[i] = Integer.valueOf(ids[i]);
        }
        return  idInt;
    }
}
